{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# The MarketDataPattern class allows the user to select a collection of observable market data\n",
    "# MarketDataPattern arguments include: mkt_type, mkt_asset, mkt_class, mkt_point and mkt_quoting_style\n",
    "from gs_quant.risk import MarketDataPattern"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "# A MarketDataPattern defined with 'CD' mkt_type contains market data related to credit instruments\n",
    "# (such as CDS, Index Spreads, Recovery Rates, etc.)\n",
    "\n",
    "cd = MarketDataPattern(mkt_type='CD')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    },
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "# The collection of 'CD' market data can be further constrained by setting the 'mkt_class'\n",
    "\n",
    "# CDS Index Products are selected by the 'INDEX' mkt_class\n",
    "index = MarketDataPattern(mkt_type='CD', mkt_class='INDEX')\n",
    "# The mkt_asset isolates the series and mt_point indicates maturity\n",
    "index_series = MarketDataPattern(mkt_type='CD', mkt_asset='ITRAXX EUROPE`36', mkt_class='INDEX', mkt_point='5Y')\n",
    "\n",
    "# CDS are selected by the 'CDS' mkt_class and mkt_asset isolates the specific cds curve\n",
    "cds = MarketDataPattern(mkt_type='CD', mkt_class='CDS')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}